package com.dldata.devtools30.repository.api;


import com.dldata.devtools30.entity.DevtApiTjoptcheckEntity;
import com.dldata.devtools30.repository.BaseRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**

 */
@Repository
public  interface DevtApiTjoptcheckEntityDao extends BaseRepository<DevtApiTjoptcheckEntity,String>, JpaSpecificationExecutor<DevtApiTjoptcheckEntity> {

        @Query("select t from DevtApiTjoptcheckEntity t order by t.active")
        public  List<DevtApiTjoptcheckEntity> getAllFormFieldCheck();


        @Query("select t from DevtApiTjoptcheckEntity t where t.name like  ?1 or t.errorinfo like  ?1   order by t.active")
        public  List<DevtApiTjoptcheckEntity> getAllFormFieldCheck(String serach);

       @Query("select t from DevtApiTjoptcheckEntity t where (t.name like  ?1  or t.errorinfo like ?1 ) and t.subId = ?2  order by t.active")
        public  List<DevtApiTjoptcheckEntity> getAllFormFieldCheck(String serach, String subId);


        @Query("select f from DevtApiTjoptcheckEntity f where f.subId = ?1 order by  f.active")
        public  List<DevtApiTjoptcheckEntity> getFormFieldCheckByFormId(String subId);


        @Query("select f from DevtApiTjoptcheckEntity f where f.subId = ?1 and f.active=1 order by  f.active")
        public  List<DevtApiTjoptcheckEntity> getActieFormFieldCheckByFormId(String subId);
        
}
